package top.zyblogs.datasourcedemo.ds2.user.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import top.zyblogs.datasourcedemo.ds1.user.dao.UserMapper;
import top.zyblogs.datasourcedemo.ds1.user.entity.User;
@Service
public class UserServiceImpl implements UserService{
	@Autowired
	private UserMapper userMapper;
	
	@Override
	public List<User> selectAllUsers() {
		// TODO Auto-generated method stub
		List<User> users=userMapper.findAllUser();
		return users;
	}

	@Override
	public void insertUser(User user) {
		// TODO Auto-generated method stub
		userMapper.insertSelective(user);
	}

	@Override
	public List<Integer> getId() {
		// TODO Auto-generated method stub
		List<Integer> userIdList=userMapper.getId();
		return userIdList;
	}
	@Override
	public Integer updateUser(User user) {
		// TODO Auto-generated method stub
		Integer integer=userMapper.updateByPrimaryKey(user);
		return integer;
	}
}
